package com.example.tetris.logics.controller;

import com.example.tetris.logics.components.CellList;
import com.example.tetris.logics.components.SHAPE;
import com.example.tetris.logics.components.ScoreInfo;
import com.example.tetris.logics.components.Tetromino;

import java.io.Serializable;

public class ViewData implements Serializable {
    CellList gameWindowDataCells;
    CellList nextBrickDataCells;



    ScoreInfo scoreInfo;



    public ViewData(CellList gameWindowDataCells, SHAPE nextBrickShape, ScoreInfo scoreInfo) {
        this.gameWindowDataCells = gameWindowDataCells;
        this.scoreInfo = scoreInfo;
        nextBrickDataCells = new CellList();
        int[][] shapeMatrix = Tetromino.getShape(nextBrickShape,0);
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 4; j++) {
                if (shapeMatrix[i][j] != 0) {
                    nextBrickDataCells.addCell(j,i);
                }
            }
        }
    }

    public CellList getGameWindowDataCells() {
        return gameWindowDataCells;
    }

    public CellList getNextBrickDataCells() {
        return nextBrickDataCells;
    }
    public ScoreInfo getScoreInfo() {
        return scoreInfo;
    }
}
